home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 924 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: abell@mindspring.com (Andrew Bell)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Quick questions
  5. Date: 01 Apr 1996 10:16:18 PST
  6. Organization: MindSpring Enterprises
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4jnj9d$1jc8@mule1.mindspring.com>
  9. References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM> <4jajk2$17aq@mule1.mindspring.com> <KANZE.96Mar28102433@gabi.gabi-soft.fr>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: Mon, 01 Apr 1996 03:44:03 GMT
  12. X-Newsreader: Forte Agent .99.82
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMWAddEy4NqrwXLNJAQGQhgIAvk/vXnMLWGHcRYkPQf0TPGHhMx60mqMx
  15.     Et/tx6i0DPcsSRwYaUHgyCpwZdZLnfx83Q7w+QTHG4Xs1BGern5pHw==
  16.     =Uy1B
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. kanze@gabi-soft.fr (J. Kanze) wrote:
  20. >You have it the other way.  The conversion operator is called a
  21. >constructor.  Thus, to take a concrete example (based on the deleted
  22. >parts of your posting (`stat' is a struct defined by Posix):
  23.  
  24. >    class FileStat : stat
  25. >    {
  26. >    public :
  27. >                        FileStat( stat const& other ) ;
  28. >        //  ...
  29. >    } ;
  30.  
  31. That's fine when your base class is a small thing; not so good when
  32. you're dealing with a large bitmap or (in my case) a Windows OLE
  33. variant structure, or if you want it passed as a non-const parm.  Few
  34. compilers would do the implicit conversion without creating a
  35. temporary; none would do so if we have any logic at all in the
  36. constructor, for example if our derived class shouldn't apply to all
  37. versions of the base class.
  38.  
  39. Andrew Bell
  40. abell@mindspring.com
  41. ---
  42. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  43.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  44.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  45.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  46.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  47. ]
  48.